package DataModel.LayoutParser;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.LinkedList;

import DataModel.LayoutManager.*;

public class CLayoutParser 
{
	/***************************************************/
	/****** C'tors *************************************/
	/***************************************************/
	
	/**
	 * CLayout Parser - module for layout parsing.
	 * @param inputURL - path or URL to the input textual layout
	 */
	public CLayoutParser(String inputURL) 
	{		
	
		File file = new File(inputURL);		
		URL fileURL = null;
		
		try 
		{
			fileURL = file.getAbsoluteFile().toURI().toURL();
		} 
		catch (MalformedURLException e) 
		{
			e.printStackTrace();
		}
		
		m_recsList = new LinkedList<CRectangle>();
		
		CIFImporter cifParser = new CIFImporter(fileURL,m_recsList);
		
		cifParser.Parse();
	}
	
	/***************************************************/
	/****** Members ************************************/
	/***************************************************/
	private LinkedList<CRectangle> m_recsList;

	/***************************************************/
	/****** Getters / Setters **************************/
	/***************************************************/
	public LinkedList<CRectangle> getRecsList() {
		return m_recsList;
	}

	public void setRecsList(LinkedList<CRectangle> list) {
		m_recsList = list;
	}
}





